package com.example.design.controller;

import com.example.design.pojo.BusinessLaunch;
import com.example.design.pojo.UserInfo;
import com.example.design.sercive.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
//@RequestMapping("")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/login")
    public String login(String account,String password)
    {
        return userService.login(account,password);
    }

    @PostMapping("/register")
    public String register(@RequestBody UserInfo userInfo)
    {
        return userService.register(userInfo);
    }

    @PostMapping("/business/launch")
    public List<BusinessLaunch> filterBUsinessLaunch(@RequestParam String city,@RequestParam String sex,@RequestParam String product)
    {
        return userService.filterBusinessLaunch(city,sex,product);
    }

    @PostMapping("/ticket")
    public Object createTicket(String type, String productId, String content, String title, String bankInfo, String taxId)
    {
        return userService.createTicket(type,productId,content,title,bankInfo,taxId);
    }
}
